<!DOCTYPE html>

<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->

<!-- Head BEGIN -->
<head>
    <meta charset="utf-8">
    <title><?php echo $this->obj->getValidateMessage('chaxunjieguo'); ?>
        - <?php echo $this->host['webtitle']; ?></title>
    <?php echo $this->view->getPartial('layouts/_meta') ?>
</head>
<!-- Head END -->

<!-- Body BEGIN -->
<body class="ecommerce">

<?php echo $this->view->getPartial('layouts/_header') ?>

<div class="main">
    <div class="container">
        <ul class="breadcrumb">
            <li><a href="index.html"><?php echo $this->obj->getValidateMessage('shouye'); ?></a></li>
            <li class="active"><?php echo $this->obj->getValidateMessage('chaxunjieguo'); ?></li>
        </ul>

        <!-- BEGIN SIDEBAR & CONTENT -->
        <div class="row margin-bottom-40">

            <?php echo $this->view->getPartial('layouts/_sidebar'); ?>

            <!-- BEGIN CONTENT -->
            <div class="col-md-9 col-sm-7">

                <!-- BEGIN PRODUCT LIST -->
                <div class="child_product_list row product-list">

                    <?php
                    if (isset($page)) {
                        foreach ($page->items as $item) {
                            ?>
                            <!-- PRODUCT ITEM START -->
                            <div class="col-md-4 col-sm-6 col-xs-12">
                                <div class="product-item">
                                    <div class="pi-img-wrapper">
                                        <img src="<?php echo \Asa\Erp\Util::getCorrentImgUrl($this->file_prex . $item['picture']); ?>"
                                             class="img-responsive"
                                             alt="<?php echo $item['productname']; ?>">
                                        <div>
                                            <a href="<?php echo $this->file_prex . $item['picture']; ?>"
                                               class="btn btn-default fancybox-button">Zoom</a>
                                        </div>
                                    </div>
                                    <h3>
                                        <a href="/product/detail/<?php echo $item['id']; ?>"><?php echo $item['productname']; ?></a>
                                    </h3>
                                    <div class="pi-price"><?php echo $this->currency; ?><?php echo $item['realprice']; ?></div>
                                </div>
                            </div>
                            <!-- PRODUCT ITEM END -->
                            <?php
                        }
                    }
                    ?>

                </div>
                <!-- END PRODUCT LIST -->

                <!-- BEGIN PAGINATOR -->
                <?php if (isset($page) && isset($keyword) && $page->total_pages > 1) { ?>
                    <div class="page_margin pull-right">
                        <ul class="pagination ">
                            <li class="<?php echo $page->current <= 1 ? 'disabled' : ''; ?>"><a
                                        href="<?php echo $this->url->get('index/search', ['page' => $page->before, 'keyword' => $keyword]); ?>">&laquo;</a>
                            </li>
                            <?php for ($i = 1; $i <= $page->total_pages; $i++) { ?>
                                <li class="<?php echo $page->current == $i ? 'active' : ''; ?>"><a
                                            href="<?php echo $this->url->get('index/search', ['page' => $i, 'keyword' => $keyword]); ?>"><?php echo $i; ?></a>
                                </li>
                            <?php } ?>
                            <li class="<?php echo $page->current >= $page->total_pages ? 'disabled' : ''; ?>"><a
                                        href="<?php echo $this->url->get('index/search', ['page' => $page->next, 'keyword' => $keyword]); ?>">&raquo;</a>
                            </li>
                        </ul>
                    </div>
                <?php } ?>
                <!-- END PAGINATOR -->

            </div>
            <!-- END CONTENT -->

        </div>
        <!-- END SIDEBAR & CONTENT -->

    </div>
</div>

<?php echo $this->view->getPartial('layouts/_footer'); ?>

</body>
<!-- END BODY -->
</html>